<template>
  <div class="main">
    <div class="listTop">
      <header class="head">
        <van-icon name="arrow-left" class="reBtn" @click="reBack()" />
        {{ topFont }}
      </header>
      <div class="record-cc">
        <div class="detail-title">企业画像</div>
        <van-cell-group>
          <van-cell title="企业基本信息" >
            <template #label>
              <div class="content">
                <div class="detail-text">
                  <div class="detail-name">企业名称：</div>
                  <div class="detail-content">{{ detail.qyName || '--'}}</div>
                </div>
                <div class="detail-text">
                  <div class="detail-name">地址：</div>
                  <div class="detail-content">XXXXXXXX地址</div>
                </div>
                <div class="detail-text">
                  <div class="detail-name">行业类别：</div>
                  <div class="detail-content">XXX类别</div>
                </div>
                <div class="detail-text">
                  <div class="detail-name">注册资金规模：</div>
                  <div class="detail-content">20-99人</div>
                </div>
                <div class="detail-text">
                  <div class="detail-name">成员数：</div>
                  <div class="detail-content">10</div>
                </div>
              </div>
            </template>
          </van-cell>
          <van-cell title="建档情况" >
            <template #label>
              <div class="content">
                <div class="detail-text">
                  <div class="detail-name">集团名称：</div>
                  <div class="detail-content">XXXXXXXX集团</div>
                </div>
                <div class="detail-text">
                  <div class="detail-name">集团编码：</div>
                  <div class="detail-content">65454477</div>
                </div>
                <div class="detail-text">
                  <div class="detail-name">集团级别：</div>
                  <div class="detail-content">一级</div>
                </div>
                <div class="detail-text">
                  <div class="detail-name">客户经理：</div>
                  <div class="detail-content">张三</div>
                </div>
                <van-tag plain type="success" class="tag-right" v-if="detail.isJd">已建档</van-tag>
                <van-tag plain color="#aaa" class="tag-right" v-else>未建档</van-tag>
              </div>
            </template>
          </van-cell>
          <van-cell title="信息化收入" >
            <template #label>
              <div class="content">
                <div class="detail-text">
                  <div class="detail-name">各项入格产品收入：</div>
                  <div class="detail-content">100万</div>
                </div>
                <div class="detail-text">
                  <div class="detail-name">信息化总收入：</div>
                  <div class="detail-content">56.7万</div>
                </div>
                <div class="detail-text">
                  <div class="detail-name">已渗透业务：</div>
                  <div class="detail-content">32.6万</div>
                </div>
              </div>
            </template>
          </van-cell>
          <van-cell title="成员信息" >
            <template #label>
              <div class="content">
                <div class="detail-text">
                  <div class="detail-name">异网客户数：</div>
                  <div class="detail-content">5674</div>
                </div>
                <div class="detail-text">
                  <div class="detail-name">我网客户数：</div>
                  <div class="detail-content">24789</div>
                </div>
              </div>
            </template>
          </van-cell>
        </van-cell-group>
        <div class="detail-title">产品推荐</div>
        <van-cell-group>
          <van-cell :title="item.name" v-for="item, i in (detail.cptjList || [])" :key="i">
            <template #label>
              <div class="content">
                <div class="detail-text">
                 {{ item.value || '--' }}
                </div>
              </div>
            </template>
          </van-cell>
        </van-cell-group>
        <div class="detail-title">营销策略</div>
        <van-cell-group>
          <van-cell :title="item.name" v-for="item, i in (detail.yxclList || [])" :key="i">
            <template #label>
              <div class="content">
                <div class="detail-text">
                  <div class="detail-name">产品简介：</div>
                  <div class="detail-content">产品简介产品简介产品简介产品简介产品简介</div>
                </div>
                <div class="detail-text">
                  <div class="detail-name">资费：</div>
                  <div class="detail-content">13.89万</div>
                </div>
                <div class="detail-text">
                  <div class="detail-name">酬金：</div>
                  <div class="detail-content">13.89万</div>
                </div>
                <div class="detail-text">
                  <div class="detail-name">营销话术：</div>
                  <div class="detail-content">XXX营销话术</div>
                </div>
                <div class="detail-text">
                  <div class="detail-name">Q&A：</div>
                  <div class="detail-content">XXX问题及解决方案</div>
                </div>
                <div class="detail-text">
                  <div class="detail-name">成功案例：</div>
                  <div class="detail-content">成功案例</div>
                </div>
                <div class="detail-text">
                  <div class="detail-name">辅助一线人员：</div>
                  <div class="detail-content">李四</div>
                </div>
              </div>
            </template>
          </van-cell>
        </van-cell-group>
      </div>
    </div>
  </div>
</template>

<script>
import { mapActions } from "vuex";

export default {
  data() {
    return {
      font: "",
      checked: false,
      topFont: "营销拓展",
      id: "",
      action: "",
      recordList: [1, 2, 3],
      processInstanceId: "",
      detail: {},
      queryParams: {}
    };
  },

  mounted() {
    const queryParams = this.$route.query;
    console.log('queryParams', queryParams)
    this.queryParams = queryParams || {userId: '', qyId: ''}
    this.getDetail();
  },
  methods: {
    ...mapActions({
      getApiDetail: "pageApi/getApiDetail"
    }),
    tabAct(index) {
      this.act = index;
    },
    reBack() {
      this.$router.go(-1);
    },
    jump() {
      this.$router.push({ name: "main" });
    },
    getDetail(){
      this.getApiDetail({
          ...this.queryParams
      }).then((res) => {
        if (res.data.code == 200) {
          let data = res?.data?.data || {}
          console.log('data=======>', data)
          this.detail = data
        } else {
          this.$toast(res.data.msg || '接口请求失败');
        }
      });
    }
  },
};
</script>

<style lang="scss" scoped type='text/css'>
.main {
  background-color: #f3f3f3;
  height: 100%;
}

.detail-title{
  font-size: 2.8rem;
  color: #007BFF;
  font-weight: bold;
  height: 8rem;
  line-height: 8rem;
  padding: 0 2.4rem;
}
.detail-text{
  display: flex;
}
.van-cell-group {
    background-color: #fff;
    width: calc(100% - 4.8rem);
    margin-left: 2.4rem;
    border-radius: 7px;
    overflow: hidden;
}
.listTop {
  height: 100%;
  color: #333;
  background: #f8f8f8;

  .head {
    font-size: 3.4rem;
    text-align: center;
    position: relative;
    color: #fff;
    padding: 3rem 0 3rem;
    background: #4673FB;

    .reBtn {
      position: absolute;
      left: 1.5rem;
      top: 2.5rem;
      font-size: 4.8rem;
    }
  }
}

.title {
  color: #333;
  font-size: 3rem;
  font-weight: 560;
  padding: 3rem 2.4rem;
  font-family: "黑体";
}

.textBorder {
  width: 100%;
  padding: 2.4rem;
  margin-bottom: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;

  .current-time {
    position: absolute;
    color: white;
    padding: 10px;
    z-index: 999;
    width: 140px;
    display: flex;
    align-items: center;
    flex-direction: column;
    justify-content: center;

    /* 文字周围的填充 */
    .text1 {
      font-size: 18px;
    }

    .text2 {
      margin-top: 10px;
      font-size: 16px;
    }
  }
}

.content {
  flex-wrap: wrap;
  display: flex;
}
.detail-content{
  margin-right: 2.4rem;
}
.record-cc {
  width: 100%;
  color: #000;
  font-size: 2.5rem;
  line-height: 20px;
  height: calc(100% - 55px);
  overflow-y: auto;
  padding-bottom: 16px;
  .record-item {
    margin-bottom: 25px;
    width: 100%;

    .record-time {
      width: 100%;
      display: flex;
      align-items: center;

      i {
        display: block;
        width: 10px;
        height: 10px;
        border-radius: 50%;
        background: #DDDDDD;
      }
    }

    .address {
      color: #666;
      font-size: 14px;
      margin-top: 8px;
      padding-left: 8px
    }

  }
}

.submit {
  border-radius: 4.4rem;
  color: #fff;
  font-size: 2.8rem;
  font-family: "黑体";
  background: #2456ff;
  height: 8.8rem;
  width: 55rem;
  border: none;
  display: block;
  margin: 0 auto;
  text-align: center;
}

.jump {
  border-radius: 4.4rem;
  color: #fff;
  font-size: 2.8rem;
  font-family: "黑体";
  background: #2456ff;
  height: 6.4rem;
  width: 28rem;
  border: none;
  display: block;
  margin: 0 auto;
  text-align: center;
}

.img {
  width: 40rem;
  height: 40rem;
  display: block;
  margin: 18rem auto 4.8rem;
}

.tips {
  color: #999;
  font-size: 2.8rem;
  margin-bottom: 8rem;
  text-align: center;
}
.tag-right{
  position: absolute;
  right: 16px;
  top: 14px;
}
</style>